package com.xbk.seckill.reservation.application.builder;

import cn.hutool.core.bean.BeanUtil;
import com.xbk.seckill.common.builder.SeckillCommonBuilder;
import com.xbk.seckill.reservation.application.command.SeckillReservationUserCommand;
import com.xbk.seckill.reservation.domain.model.entity.SeckillReservationUser;

/**
 * @author xiexu
 * @date 2025/5/2 21:50
 */
public class SeckillReservationUserBuilder extends SeckillCommonBuilder {

    public static SeckillReservationUser toSeckillReservationUser(SeckillReservationUserCommand seckillReservationUserCommand) {
        if (seckillReservationUserCommand == null || seckillReservationUserCommand.isEmpty()) {
            return null;
        }
        SeckillReservationUser seckillReservationUser = new SeckillReservationUser();
        BeanUtil.copyProperties(seckillReservationUserCommand, seckillReservationUser);
        return seckillReservationUser;
    }

}
